The technology presented herein relates to a game device and a storage medium storing a game program, and more particularly to a game device and a storage medium storing a game program, in which a game process is performed according to data outputted from an acceleration sensor.
There are various types of conventional game devices capable of displaying, on a display device, a baseball game performed in a virtual game world. For example, “Wii Sports instructions manual”, Nintendo Co., Ltd., Dec. 2, 2006 (date of sale), pp. 14-15 (hereinafter referred to as “Non-Patent Document 1”) describes a baseball game in which a game operation is performed by swinging a game controller being held in the hand of the player. In the baseball game described in Non-Patent Document 1, the player swings down the game controller as if the player would throw the ball to thereby activate a pitching operation in the baseball game (the pitcher pitches the ball in the game). A breaking ball can be thrown in the baseball game if the player swings down the game controller while holding down the A button or the B button of the game controller.
When a pitcher throws a breaking ball in a real baseball game, the pitcher typically gives a twist to the ball. However, when throwing a breaking ball in the game device described in Non-Patent Document 1, the player selects the type of pitch by a button operation but not by giving a twist to the game controller being held by the player. This introduces an unnatural element to the game. Moreover, the player needs to remember which button to press for each type of pitch, thus making the operation more complicated than real pitching.
Therefore, a feature of an example embodiment presented herein is to provide a game device and a storage medium storing a game program, which realize a more intuitive and simpler operation input by using data outputted from an acceleration sensor.
The present embodiment has the following features to attain the above. Note that parenthetic expressions in the following section (reference numerals, step numbers, etc.) are merely to indicate the correlation between what is described in the following section and what is described in the description of the preferred embodiments set out further below in the present specification, and are in no way intended to restrict the scope of the present embodiment.
A first aspect of the present embodiment is directed to a game device (5) for performing a game process by using acceleration data (Da) outputted from a multi-axis acceleration sensor (an acceleration sensor 701 detecting accelerations in the X-, Y- and Z-axis directions) provided in an input device (7). The game device includes obtaining means (a CPU 10 performing steps 54, 58 and 87; hereinafter only the step numbers will be shown), swing detection means (S55, S56), type determination means (S59, S81, S82 to S86), object moving means (S84 to S86, S90), and display control means (S90). The obtaining means obtains the acceleration data from the input device. The swing detection means detects a swing of the input device in a real space when an acceleration represented by the acceleration data satisfies a predetermined condition (s>2.5). The type determination means determines a type of swing (swing type) of the input device in the real space by using an acceleration in a predetermined axial direction (the Y-axis direction) of the multi-axis acceleration sensor among all the accelerations represented by the acceleration data obtained by the obtaining means after the detection by the swing detection means. The object moving means moves a predetermined object (OBJ) in a virtual game space according to the type determined by the type determination means. The display control means displays the virtual game space with the object therein on a display device (2).
In a second aspect, wherein the type determination means determines the type based on the acceleration in the predetermined axial direction represented by the acceleration data, which is obtained by the obtaining means during a predetermined period of time (N=10) after the detection by the swing detection means.
In a third aspect, wherein the type determination means selects one type from among a plurality of types (FIGS. 10 to 12) pre-defined based on a twist given to the input device assembly when the input device is swung in the real space, based on the acceleration in the predetermined axial direction.
In a fourth aspect, wherein the type determination means selects one type from among the plurality of types based on a comparison between a predetermined threshold value (the first determination value, the second determination value) and the acceleration in the predetermined axial direction (S82, S83).
In a fifth aspect, wherein the type determination means determines, in advance, a first threshold value (1.0) to be greater than a reference value (accY=0) and a second threshold value (−1.6) to be smaller than the reference value so that a difference between the first threshold value and the reference value is different from a difference between the second threshold value and the reference value, wherein the reference value is a value of the acceleration in the predetermined axial direction occurring when the input device is swung with no twist being given to the input device assembly. The type determination means selects one of the plurality of types based on a comparison between the first and second threshold values and the acceleration in the predetermined axial direction.
In a sixth aspect, wherein the predetermined axial direction is a direction perpendicular to a direction of an axis (the Z axis) about which the input device assembly is twisted.
In a seventh aspect, wherein the object moving means includes change-of-direction type selecting means (S84 to S86). The change-of-direction type selecting means selects one of a plurality of change-of-direction types (the types of pitch: fastball, curveball, screwball) based on the type determined by the type determination means, each change-of-direction type representing a direction in which a movement direction of the object changes in the virtual game space. The object moving means moves the object in the virtual game space according to the change-of-direction type selected by the change-of-direction type selecting means.
In an eighth aspect, wherein the game device further includes acceleration history storage means (S54, S58, S87) and moving speed determination means (S101 to S103). The acceleration history storage means stores a history of acceleration data obtained by the obtaining means over a predetermined period of time (N=15). The moving speed determination means determines a moving speed (the ball speed) of the object in the virtual game space based on changes in an acceleration in the predetermined axial direction (the Y-axis direction) and that in an axial direction (the X-axis direction) other than the predetermined axial direction among all the accelerations represented by the history of acceleration data stored in the acceleration history storage means. The object moving means moves the object according to the moving speed determined by the moving speed determination means.
In a ninth aspect, wherein the input device includes a control button (72) for outputting predetermined control data (Db) when pressed down by a player. The obtaining means further obtains the control data from the input device (S51). The swing detection means detects a swing of the input device when the acceleration represented by the acceleration data satisfies the predetermined condition while the control data indicating that a predetermined control button (72i) is pressed down is being obtained (Yes in S53).
A tenth aspect of the present embodiment is directed to a storage medium storing a game program to be executed by a computer (10) of a game device for performing a game process by using acceleration data outputted from a multi-axis acceleration sensor provided in an input device. The game program instructs the computer to function as obtaining means, swing detection means, type determination means, object moving means, and display control means. The obtaining means obtains the acceleration data from the input device. The swing detection means detects a swing of the input device in a real space when an acceleration represented by the acceleration data satisfies a predetermined condition. The type determination means determines a type of swing of the input device in the real space by using an acceleration in a predetermined axial direction of the multi-axis acceleration sensor among all the accelerations represented by the acceleration data obtained by the obtaining means after the detection by the swing detection means. The object moving means moves a predetermined object in a virtual game space according to the type determined by the type determination means. The display control means displays the virtual game space with the object therein on a display device.
In an eleventh aspect, wherein the type determination means determines the type based on the acceleration in the predetermined axial direction represented by the acceleration data, which is obtained by the obtaining means during a predetermined period of time after the detection by the swing detection means.
In a twelfth aspect based on the tenth aspect, wherein the type determination means selects one type from among a plurality of types pre-defined based on a twist given to the input device assembly when the input device is swung in the real space, based on the acceleration in the predetermined axial direction.
In a thirteenth aspect, wherein the type determination means selects one type from among the plurality of types based on a comparison between a predetermined threshold value and the acceleration in the predetermined axial direction.
In a fourteenth aspect, wherein the type determination means determines, in advance, a first threshold value to be greater than a reference value and a second threshold value to be smaller than the reference value so that a difference between the first threshold value and the reference value is different from a difference between the second threshold value and the reference value, wherein the reference value is a value of the acceleration in the predetermined axial direction occurring when the input device is swung with no twist being given to the input device assembly. The type determination means selects one of the plurality of types based on a comparison between the first and second threshold values and the acceleration in the predetermined axial direction.
In a fifteenth aspect, wherein the predetermined axial direction is a direction perpendicular to a direction of an axis about which the input device assembly is twisted.
In a sixteenth aspect, wherein the object moving means includes change-of-direction type selecting means. The change-of-direction type selecting means selects one of a plurality of change-of-direction types based on the type determined by the type determination means, each change-of-direction type representing a direction in which a movement direction of the object changes in the virtual game space. The object moving means moves the object in the virtual game space according to the change-of-direction type selected by the change-of-direction type selecting means.
In a seventeenth aspect, wherein the game program instructs the computer to function further as acceleration history storage control means and moving speed determination means. The acceleration history storage means stores in a memory (12, 35) a history of acceleration data obtained by the obtaining means over a predetermined period of time. The moving speed determination means determines a moving speed of the object in the virtual game space based on changes in an acceleration in the predetermined axial direction and that in an axial direction other than the predetermined axial direction among all the accelerations represented by the history of acceleration data stored in the memory. The object moving means moves the object according to the moving speed determined by the moving speed determination means.
In an eighteenth aspect, wherein the input device includes a control button for outputting predetermined control data when pressed down by a player. The obtaining means further obtains the control data from the input device. The swing detection means detects a swing of the input device when the acceleration represented by the acceleration data satisfies the predetermined condition while the control data indicating that a predetermined control button is pressed down is being obtained.
According to the first aspect, it is possible to determine the type of swing of the input device provided with the multi-axis acceleration sensor in the real space by using the detected acceleration in the predetermined axial direction. By moving the object using the determined type, it is possible to realize a control input that is more intuitive and simpler for the player.
According to the second aspect, the swing type of the input device is determined by using only the acceleration in the predetermined axial direction occurring during a period of time that is necessary for determining the type, thus enabling an appropriate type determination. For example, by using the acceleration occurring during a period of time from the start of the swing of the input device to the release of the ball, it is possible to determine the type of twist given to the ball when the ball is thrown in a realistic manner.
According to the third aspect, it is possible to make an input intuitively through a simple operation such as simply swinging the input device while twisting the input device.
According to the fourth aspect, the type is determined based on a comparison between a threshold value and the acceleration in the predetermined axial direction, thereby simplifying the type determination process.
According to the fifth aspect, it is possible to realize a determination in consideration of the natural movement of a human arm swinging the input device while twisting the input device.
According to the sixth aspect, the acceleration occurring in a predetermined axial direction changes according to a twist when the input device assembly is swung while being twisted, whereby it is possible to easily detect the presence/absence of a twist based only on the acceleration occurring in the predetermined axial direction. If the predetermined axial direction before the input device assembly is twisted is also perpendicular to the swing direction, the acceleration occurring in the predetermined axial direction changes differently according to the twist direction, whereby it is possible to easily detect the twist direction based only on the acceleration occurring in the predetermined axial direction.
According to the seventh aspect, the type of the movement of the object (e.g., the type of pitch thrown by a pitcher) is selected based on the determined swing type of the input device. Therefore, the change of direction of the object can be controlled based on the swing type by the player swinging the input device while twisting the input device, thus facilitating such a control operation as a pitcher throwing a breaking ball, for example.
According to the eighth aspect, it is possible to determine both the moving direction and the moving speed of an object through a simple operation of swinging the input device.
According to the ninth aspect, it is possible to prevent an erroneous determination, which may otherwise occur when the player inadvertently swings the input device without intending to perform a control operation. Moreover, the player is required to press down a predetermined control button when holding the input device in hand, thus naturally forcing the player to hold the input device in an intended manner.
With a storage medium storing a game program of the present embodiment, it is possible to realize advantageous effects similar to those described above for the game device of the present embodiment.
These and other features, aspects and advantages of the present embodiment will become more apparent from the following detailed description of the present embodiment when taken in conjunction with the accompanying drawings.